<div class="page-content">
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <a href="/admin">系统</a>
            </li>
            <li class="active">栏目管理</li>
        </ul>
    </div>
    <div class="page-body">
        <button type="button" tooltip="添加栏目" class="btn btn-sm btn-azure btn-addon" onClick="javascript:window.location.href = '{:url('add')}'"> <i class="fa fa-plus"></i> Add
        </button>
        <div class="row">
            <div class="col-lg-12 col-sm-12 col-xs-12">
                <div class="widget">
                    <div class="widget-body">
                        <div class="flip-scroll">
                            <form action="" method="post">
                                <table class="table table-bordered table-hover">
                                    <thead class="">
                                    <tr>
                                        <th class="text-center" width="5%">ID</th>
                                        <th class="text-center" width="5%">排序</th>
                                        <th class="text-center">栏目名称</th>
                                        <th class="text-center">栏目类型</th>
                                        <th class="text-center">缩略图</th>
                                        <th class="text-center" width="20%">操作</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {volist name="cates" id="cate"}
                                    <tr>
                                        <td align="center">{$cate.id}</td>
                                        <td align="center"><input name="{$cate.id}" type="text" style="width:50px; text-align:center;" value="{$cate.sort}"></td>
                                        <!--  $cate['level'] neq 0"}=》 level不为0  输出“|”； str_repeat('-', $cate['level']*8)=》反复输出分隔符“-”，level*8次-->
                                        <td>{if condition="$cate['level'] neq 0"}|{/if}<?php echo str_repeat('-', $cate['level']*8)?>{$cate.catename}</td>
                                        <td align="center">
                                            {if condition="$cate['type'] eq 1"}
                                            文章列表
                                            {elseif condition="$cate['type'] eq 3" }
                                            图片列表
                                            {else /}
                                            单页
                                            {/if}
                                        </td>
                                        <td align="center">
                                            {if condition="$cate['thumb'] neq ''"}
                                            <img src="{$cate.thumb}" height="30">
                                            {else /}
                                            暂无缩略图
                                            {/if}
                                        </td>
                                        <td align="center">
                                            <a href="{:url('edit',array('id'=>$cate['id']))}" class="btn btn-primary btn-sm shiny">
                                                <i class="fa fa-edit"></i> 编辑
                                            </a>
                                            <a href="#" onClick="warning('确实要删除吗', '{:url('del',array('id'=>$cate['id']))}')" class="btn btn-danger btn-sm shiny">
                                                <i class="fa fa-trash-o"></i> 删除
                                            </a>
                                        </td>
                                    </tr>
                                    {/volist}
                                    <tr><td width="5%"></td><td width="5%" align="center" style="text-align: center"><input class="btn btn-primary btn-sm shiny" type="submit" value="排序" ></td><td></td><td></td><td></td></tr>
                                    </tbody>
                                </table>
                            </form>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
